package com.handpay.nocardpay.baselibrary.commbase.model.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author sxshi on 2017/4/25.
 *         email:emotiona_xiaoshi@126.com
 *         describe:统一封装all错误信息
 */

public class BaseErrorInfo implements Parcelable {
    public String responseCode;
    public String errMessage;

    public BaseErrorInfo() {
    }

    public BaseErrorInfo(String responseCode, String errMessage) {
        this.responseCode = responseCode;
        this.errMessage = errMessage;
    }

    @Override
    public String toString() {
        return "BaseErrorInfo{" + "responseCode='" + responseCode + '\'' + ", errMessage='" + errMessage + '\'' + '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.responseCode);
        dest.writeString(this.errMessage);
    }

    protected BaseErrorInfo(Parcel in) {
        this.responseCode = in.readString();
        this.errMessage = in.readString();
    }

    public static final Parcelable.Creator<BaseErrorInfo> CREATOR = new Parcelable.Creator<BaseErrorInfo>() {
        @Override
        public BaseErrorInfo createFromParcel(Parcel source) {
            return new BaseErrorInfo(source);
        }

        @Override
        public BaseErrorInfo[] newArray(int size) {
            return new BaseErrorInfo[size];
        }
    };
}
